﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：IQuartzScheduleJobManager.cs
// 功能描述：TongTongMall.Quartz
// 
// Create User：jym 2017/02/16
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.Quartz.Quartz
{
    public interface IQuartzScheduleJobManager
    { 
        /// <summary>
        /// 增加任务与任务调度到任务工厂
        /// </summary>
        /// <typeparam name="TJob"></typeparam>
        /// <param name="configureJob">任务</param>
        /// <param name="configureTrigger">任务调度</param>
        /// <returns></returns>
        Task ScheduleAsync<TJob>(Action<JobBuilder> configureJob, Action<TriggerBuilder> configureTrigger) where TJob : IJob;

        /// <summary>
        /// 启动任务
        /// </summary>
        void Start();

        /// <summary>
        /// 等待任务完成并停止任务
        /// </summary>
        void ShutDown();
    }
}
